const CracoAntDesignPlugin = require("craco-antd");
const CracoAlias = require("craco-alias");

module.exports = {
  module: { // 所有第三方模块的配置规则
    rules: [ // 第三方匹配规则
      {
        test: /\.js|jsx$/,
        use: "babel-loader",
        exclude: /node_modules/ // exclude千万别忘记
      }
    ]
  },
  plugins: [
    {
      plugin: CracoAntDesignPlugin,
      options: {
        /* customizeTheme 和 customizeThemeLessPath 任选其一 */
        customizeTheme: {
          "@primary-color": "#7546c9",
          "@link-color": "#7546c9"
        }
        // customizeThemeLessPath: path.join(__dirname, "src/style/theme.less"),
      }
    },
    {
      plugin: CracoAlias,
      options: {
        source: "options",
        baseUrl: "./",
        aliases: {
          "@": "./src"
        }
      }
    }
  ]
};
